/*
 * Copyright (c) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef UPDATE_LITE_MANAGER_H
#define UPDATE_LITE_MANAGER_H

#include "update_lite_defines.h"
#include "iproxy_server.h"
#include "samgr_lite.h"
#include "serializer.h"


#include "update_lite_defines.h"

// #define UPDATE_LITE_SAMGR_SERVICE "updatelservice"
// #define UPDATE_LITE_SAMGR_FEATURE "updatelfeature"
UpdateLiteInfo ulinfo;
//char infoUrl[128];
//char firmwareUrl[128];
char* infoUrl;
char* firmwareUrl;

// typedef enum {
//     UPDATELITE_MQTT = 1
// } ConnectType;

uint32_t InitConnect(int connecttype);

void preGetFirmwareInfo(struct UpdateLiteInfo *info);

void preDownloadFirmware(struct UpdateLiteInfo *info);

uint32_t CheckFirmwareInfo(struct UpdateLiteInfo *info);

uint32_t CheckFirmwarePackage(struct UpdateLiteInfo *info);

uint32_t UpdateLocaldetection();

uint32_t UpdateClean();

/*CheckFirmwarePackage UpdateLocaldetection
typedef struct UpdateLiteService {
    INHERIT_SERVICE;
    Identity identity;
} UpdateLiteService;

typedef struct UpdateLiteFeatureApi {
    INHERIT_SERVER_IPROXY;
    int32_t (*UpdateLiteXxxApi)(IUnknown *iUnknown, IpcIo *req, IpcIo *reply);
} UpdateLiteFeatureApi;

typedef struct UpdateLiteFeature {
    INHERIT_FEATURE;
    INHERIT_IUNKNOWNENTRY(UpdateLiteFeatureApi);
    Identity identity;
    Service *parent;
} UpdateLiteFeature;

void UpdateLiteServiceInit(void);
void UpdateLiteFeatureInit(void);
*/
#endif // UPDATE_LITE_MANAGER_H
